/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package LOGICA.BDLSF;

import LOGICA.Entidades.Logdepart;
import LOGICA.Entidades.Logdistrit;
import LOGICA.HibernateUtil.HibernateUtil;
import java.util.List;
import org.hibernate.Session;

/**
 *
 * @author ricardo
 */
public class BDL_C_SFDistritoBean implements BDL_C_SFDistritoBeanRemota{

    @Override
    public List<Logdistrit> findAllDistritxDepart(String nidDepart) {
        List<Logdistrit> listaDistrit = null;
        Session sesion = HibernateUtil.getSessionFactory().getCurrentSession();
        String sql = "FROM Logdistrit WHERE logdepart.nidDepartamento = '"+nidDepart+"'";
        try{
            sesion.beginTransaction();
            listaDistrit = sesion.createQuery(sql).list();
            sesion.beginTransaction().commit();
        }catch(Exception e){
            sesion.beginTransaction().rollback();
        }
        return listaDistrit;
    }
    
    
    
}
